
class MyThread extends Thread {
    @Override
    public void run() {
        System.out.println("MyThread:run()");
    }
}

class MyRunnable implements Runnable {
    @Override
    public void run() {
        System.out.println("MyRunnable:run()");
    }
}
public class TestDemo {

    public static void main(String[] args) {
        MyThread myThread = new MyThread();
        myThread.start();

        Thread t1 = new Thread(new MyRunnable());
        t1.start();

        Thread t2 = new Thread() {
            @Override
            public void run() {
                System.out.println("Main Thread:run()");
            }
        };
        t2.start();

        Thread t3 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("Main Runnable:run()");
            }
        });
        t3.start();

        Thread t4 = new Thread(() -> {
            System.out.println("lambda:run()");
        });
        t4.start();


    }
}
